﻿<!DOCTYPE html>
<html style="font-size: 100px;">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>社区好生活-登录确认</title>
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" />
    <link href="css/ydui.css?v=1.1.4" rel="stylesheet" />
    <script src="js/ydui.flexible.js"></script>
    <style type="text/css">

        .m-cell:after {
            border-bottom: none;
        }

    </style>
</head>
<body style="background: #FFFFFF;" ms-controller="loginview" class="ms-controller">
    <section class="g-flexview">

        <header class="m-navbar">
            <a onclick="history.go(-1)" class="navbar-item">
                <i class="iconfont icon-back"></i>
            </a>
            <div class="navbar-center">
                <span class="navbar-title">登录确认</span>
            </div>
        </header>

        <div class="m-cell">
            <p style="font-size: .3rem;color:#ff8a00;padding:0.5rem 0.2rem 0rem 0.2rem;background-color:#fff;margin-top:5px;text-align:center;">
                欢迎关注社区好生活
            </p>
            <p style="font-size: .27rem;padding:0;background-color:#fff;text-align:center;">
                <img src="img/qrcode_shequ.png" style="margin:auto;width:200px;" />

            </p>
            <p style="text-align:center;font-size: .3rem;color:#ff8a00">关注可以更便捷的得到服务</p>
        </div>

        <p style="margin-top:1rem;">
            <a href="index.html" class="btn  btn-primary" style="width:95%;margin:0.2rem;">
               直接进入社区
            </a>
        </p>


</section>



    <script src="https://cdn.bootcss.com/jquery/2.2.0/jquery.min.js"></script>
    <script src="js/ydui.js"></script>
    <script src="js/avalon.mobile.min.js"></script>
    <script src="js/ComFunJS.js?v=20180331"></script>
    <script>
        var model = avalon.define({
            $id: "loginview",
            code: ComFunJS.getQueryString("code"),
            returnurl: ComFunJS.getQueryString("returnurl"),
            ref: ComFunJS.getQueryString("ref")
            

        });
        avalon.ready(function () {
            if (model.code) {
                YDUI.dialog.loading.open("登录中...");
                $.getJSON("/api1/weixin/code/" + model.code, { "ref": model.ref }, function (r) {
                    YDUI.dialog.loading.close();
                    if (r.error == "") {
                        ComFunJS.saveToken(r.result.token);
                        if (r.result.issubscribe == "1") {
                            if (model.returnurl) {
                                window.location.href = model.returnurl;
                            } else {
                                window.location.href = "index.html";
                            }

                        }

                    }

                })
            }

        })

    </script>
</body>
</html>
